<?php
namespace Model;

require_once("Model/quizDAL.php");

class quizHandler{
	
	private $quizDAL;
	private $quizzes = array();
	
	
	public function __construct(\mysqli $mysqli){
		$this->quizDAL = new \Model\quizDAL($mysqli);
		
		//$this->quizzes = $this->quizDAL->getAllQuizzes();
	}
	
	/**
	 * @param \Model\quizModel $quiz
	 */
	public function addQuizToDatabase(\Model\quizModel $quiz){
		$this->quizzes[] = $quiz;
		
		$this->quizDAL->insertQuiz($quiz);
	}

	/**
	 * @return Array (the array containing all quizzes)
	 */
	public function getAllQuizzes(){
		$this->quizzes[] = $this->quizDAL->getAllQuizzes();
		
		return $this->quizzes;
	}
}
